package com.softeem.score.model.enmu;

public enum CourseCategoryEnum {
    THEORY(1, "理论课"),
    PRACTICAL(2, "实践课"),
    EXPERIMENT(3, "实验课"),
    ELECTIVE(4, "选修课");

    private final int id;
    private final String value;

    CourseCategoryEnum(int id, String value) {
        this.id = id;
        this.value = value;
    }

    public int getId() {
        return id;
    }

    public String getValue() {
        return value;
    }

    // 根据ID获取对应的枚举值
    public static CourseCategoryEnum getById(int id) {
        for (CourseCategoryEnum category : values()) {
            if (category.id == id) {
                return category;
            }
        }
        throw new IllegalArgumentException("Invalid CourseCategoryEnum ID: " + id);
    }

}

